pub type ScheduleResult<T> = Result<T, ScheduleError>;

#[derive(Debug, Clone)]
pub enum ScheduleError {
    TaskExecutor(String),
}

impl std::fmt::Display for ScheduleError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            Self::TaskExecutor(s) => write!(f,"task execution error:{}", s),
        }
    }
}

impl std::error::Error for ScheduleError {}

impl From<String> for ScheduleError {
    fn from(value: String) -> Self {
        Self::TaskExecutor(value)
    }
}